$(function () {
    let id=localStorage.getItem("recruitmentId");
    FindById(id);
})
function FindById(id) {
    let data=myAjax("/back/news/recruitmentFindById",{id: id},"get");
    setData(data.recruitmentModel);
}

function setData(data) {
    $("#id").val(data.id);
    $("#date").val(data.date);
    $("#introduction").val(data.introduction);
    $("#wages").val(data.wages);
    $("#address").val(data.address);
    $("#phone").val(data.phone);
    $("#mailbox").val(data.mailbox);
    $("#position").val(data.position);
}

function recruitmentUpdate() {
    let da={
        id:localStorage.getItem("recruitmentId"),
        date:$.trim($("#date").val()),
        introduction:$.trim($("#introduction").val()),
        wages:$.trim($("#wages").val()),
        address:$.trim($("#address").val()),
        phone:$.trim($("#phone").val()),
        mailbox:$.trim($("#mailbox").val()),
        position:$.trim($("#position").val()),
    }
    let data=myAjax("/back/news/recruitmentUpdate",da,"post");
    if (data.count==1){
        alert("修改成功")
        $('#reght').load('/back/recruitment/recruitmentFindAll.html')//刷新一次页面
    } else {
        alert("修改失败")
    }
}